package com.freedom.pms.supplier.infrastructure.persistence.repository;

import com.freedom.pms.supplier.domain.repository.SupplierStoreRepository;
import com.freedom.pms.supplier.infrastructure.persistence.assembler.SupplierStoreAssembler;
import com.freedom.pms.supplier.infrastructure.persistence.mapper.SupplierStoreMapper;
import com.freedom.pms.supplier.infrastructure.persistence.pojo.bo.SupplierStoreBO;
import com.freedom.pms.supplier.infrastructure.persistence.pojo.po.SupplierStorePO;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

@Service
@RequiredArgsConstructor
public class SupplierStoreRepositoryImpl implements SupplierStoreRepository {

    private final SupplierStoreMapper supplierStoreMapper;

    private final SupplierStoreAssembler supplierStoreAssembler;

    @Override
    public SupplierStoreBO findById(Integer id) {
        SupplierStorePO supplierStorePO = supplierStoreMapper.selectById(id);
        return supplierStoreAssembler.toBO(supplierStorePO);
    }
}
